chore: Rename src/tgsl directory to src/codegen#2401
Conversation
|
pkg.pr.new packages benchmark commit |
📊 Bundle Size Comparison
👀 Notable resultsStatic test results:No major changes. Dynamic test results:No major changes. 📋 All resultsClick to reveal the results table (350 entries).
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu. |
Resolution Time Benchmark---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Random Branching (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.62, 1.27, 2.75, 4.08, 4.85, 7.82, 14.85, 14.85]
line [0.62, 1.21, 2.61, 4.21, 4.78, 7.53, 15.33, 15.28]
line [0.58, 1.17, 2.54, 4.29, 4.93, 6.78, 14.06, 14.22]
---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Linear Recursion (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.22, 0.36, 0.48, 0.59, 0.84, 0.83, 0.98, 1.02]
line [0.25, 0.41, 0.50, 0.62, 0.82, 0.85, 1.04, 1.14]
line [0.26, 0.38, 0.45, 0.52, 0.70, 0.74, 0.93, 1.04]
---
config:
themeVariables:
xyChart:
plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
title "Full Tree (🔴 PR | 🔵 main | 🟢 release)"
x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
y-axis "time (ms)"
line [0.61, 1.40, 2.72, 4.36, 8.22, 17.57, 36.41, 76.50]
line [0.58, 1.41, 2.37, 3.95, 8.09, 17.57, 36.15, 75.20]
line [0.65, 1.23, 2.38, 4.10, 8.32, 18.03, 37.44, 74.05]
|
There was a problem hiding this comment.
Pull request overview
Renames TypeGPU’s internal shader/TGSL code generation subsystem from src/tgsl to src/codegen, updating all internal and test imports to the new module locations.
Changes:
- Updated imports across
src/and tests to referencesrc/codegen/*instead ofsrc/tgsl/*. - Introduced the new
src/codegen/*module set (WGSL generator, conversion, helpers, shellless support, console logging codegen utilities). - Updated public exports to re-export generators from
src/codegen/*.
Reviewed changes
Copilot reviewed 28 out of 42 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/typegpu/tests/utils/parseResolved.ts | Updates test helper import to use src/codegen/wgslGenerator.ts. |
| packages/typegpu/tests/tgsl/wgslGenerator.test.ts | Updates generator/helper imports to new codegen paths. |
| packages/typegpu/tests/tgsl/typeInference.test.ts | Updates WGSL generator import path. |
| packages/typegpu/tests/tgsl/generationHelpers.test.ts | Updates helper/accessor imports to codegen. |
| packages/typegpu/tests/tgsl/conversion.test.ts | Updates conversion + generator imports to codegen. |
| packages/typegpu/tests/tgsl/consoleLog.test.ts | Updates console log deserializer import to codegen. |
| packages/typegpu/src/types.ts | Switches ShaderGenerator import to codegen location. |
| packages/typegpu/src/std/subgroup.ts | Switches unify import to codegen/conversion.ts. |
| packages/typegpu/src/std/operators.ts | Switches unify import to codegen/conversion.ts. |
| packages/typegpu/src/std/numeric.ts | Switches unify import to codegen/conversion.ts. |
| packages/typegpu/src/std/boolean.ts | Switches unify import to codegen/conversion.ts. |
| packages/typegpu/src/std/bitcast.ts | Switches unify import to codegen/conversion.ts. |
| packages/typegpu/src/resolutionCtx.ts | Repoints codegen/log/conversion/helper/generator imports to src/codegen/*. |
| packages/typegpu/src/indexNamedExports.ts | Public re-exports updated to src/codegen/*. |
| packages/typegpu/src/data/vectorImpl.ts | Switches numeric literal snippet helper import to codegen. |
| packages/typegpu/src/data/matrix.ts | Switches numeric literal snippet helper import to codegen. |
| packages/typegpu/src/data/index.ts | Switches infix operator plumbing import to codegen/accessProp.ts. |
| packages/typegpu/src/core/valueProxyUtils.ts | Switches proxy access helpers to codegen/access*. |
| packages/typegpu/src/core/simulate/tgpuSimulate.ts | Switches generator import to codegen/wgslGenerator.ts. |
| packages/typegpu/src/core/root/rootTypes.ts | Switches log/shader generator types to codegen. |
| packages/typegpu/src/core/root/init.ts | Switches log/shader generator types to codegen. |
| packages/typegpu/src/core/resolve/tgpuResolve.ts | Switches shader generator type import to codegen. |
| packages/typegpu/src/core/resolve/namespace.ts | Switches ShelllessRepository import to codegen/shellless.ts. |
| packages/typegpu/src/core/pipeline/renderPipeline.ts | Switches GPU log deserializer/types imports to codegen. |
| packages/typegpu/src/core/pipeline/computePipeline.ts | Switches GPU log deserializer/types imports to codegen. |
| packages/typegpu/src/core/function/dualImpl.ts | Switches conversion/helpers imports to codegen. |
| packages/typegpu/src/core/function/createCallableSchema.ts | Switches conversion import to codegen. |
| packages/typegpu/src/core/function/comptime.ts | Switches snippet coercion import to codegen. |
| packages/typegpu/src/codegen/wgslGenerator.ts | Adds WGSL generator implementation under codegen. |
| packages/typegpu/src/codegen/shellless.ts | Adds shellless function variant cache/repository under codegen. |
| packages/typegpu/src/codegen/shaderGenerator_members.ts | Adds member exports (e.g. UnknownData) for ShaderGenerator namespace export. |
| packages/typegpu/src/codegen/shaderGenerator.ts | Adds ShaderGenerator interface and merged namespace export under codegen. |
| packages/typegpu/src/codegen/math.ts | Adds mapping from Math.* to supported std dual-fns for codegen. |
| packages/typegpu/src/codegen/generationHelpers.ts | Adds snippet coercion/concretization + GenerationCtx utilities under codegen. |
| packages/typegpu/src/codegen/forOfUtils.ts | Adds for...of lowering utilities under codegen. |
| packages/typegpu/src/codegen/conversion.ts | Adds conversion ranking/unification utilities under codegen. |
| packages/typegpu/src/codegen/consoleLog/types.ts | Adds codegen-time console log type definitions under codegen. |
| packages/typegpu/src/codegen/consoleLog/serializers.ts | Adds GPU-side serializers used for console logging under codegen. |
| packages/typegpu/src/codegen/consoleLog/logGenerator.ts | Adds log resource allocation + log call generation under codegen. |
| packages/typegpu/src/codegen/consoleLog/deserializers.ts | Adds CPU-side deserialization + logging helper under codegen. |
| packages/typegpu/src/codegen/accessProp.ts | Adds property access lowering (swizzles, struct props, infix dispatch) under codegen. |
| packages/typegpu/src/codegen/accessIndex.ts | Adds index access lowering (arrays/vectors/matrix columns) under codegen. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import type { WgslExtension } from './wgslExtensions.ts'; | ||
| import type { Infer } from './shared/repr.ts'; | ||
| import { ShaderGenerator } from './tgsl/shaderGenerator.ts'; | ||
| import { ShaderGenerator } from './codegen/shaderGenerator.ts'; |
There was a problem hiding this comment.
This file imports ShaderGenerator as a value import, but it appears to be used only as a type in this module. With verbatimModuleSyntax enabled, prefer import type { ShaderGenerator } ... to avoid introducing an unnecessary runtime dependency / potential circular import into types.ts.
No description provided.